<!DOCTYPE html>
<!-- release v5.1.4, copyright 2014 - 2020 Kartik Visweswaran -->
<!--suppress JSUnresolvedLibraryURL -->
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Krajee JQuery Plugins - &copy; Kartik</title>

    <link rel="stylesheet" href="../bootstrap-3.3.7/css/bootstrap.css" crossorigin="anonymous">
    <link href="../themes/explorer-fas/theme.css" media="all" rel="stylesheet" type="text/css"/>
    <script src="../jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<!--    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>-->
    <script src="../bootstrap-3.3.7/js/bootstrap.js" crossorigin="anonymous"></script>
<!--    <script src="../themes/fas/theme.js" type="text/javascript"></script>-->
<!--    <script src="../themes/explorer-fas/theme.js" type="text/javascript"></script>-->
    <script src="../sks/js/sks-ui.js" type="text/javascript"></script>
</head>
<body>
<!--<div class="container my-4">-->
<!--</div>-->
<!--<div class="col-xs-5 row">-->
<!--</div>-->
<!--<div class="col-xs-2 row">-->
<!--</div>-->

<div class="container">
        <div class="row">
            <div class="col-xs-4 ">
            </div>
            <div class="col-xs-4 ">
                    <form id="registerForm" autocomplete="off" novalidate="novalidate">
                        <h4 class="no-margins">手机号：</h4>
                        <!--        <input type="password" name="password" class="form-control pword" placeholder="密码" maxlength="20">-->
                        <!--        <input type="password" name="confirmPassword" class="form-control pword" placeholder="确认密码" maxlength="20">-->
                        <input id="phonenumber" type="text" name="phonenumber" class="form-control" placeholder="请输入手机号">
                        <div class="input-group col-xs-12">
                            <input id="code" type="text" name="validateCode" class="form-control " style="color: #1a2226" placeholder="验证码" maxlength="6">
                            <span class="input-group-btn">
                            <button id="sendSns" type="button" class="btn btn-info" width="85%">发送验证码</button>-
                    </span>
                        </div>


                        <!--                    onsubmit="return resetPassword();"-->
                        <button class="btn btn-success btn-block" id="but1" onclick="return validate();" data-loading="正在验证，请稍后...">验证</button>

                    </form>
            </div>
            <div class="col-xs-4">
            </div>
        </div>
        <div class="row">
            <div class="col-xs-4">
            </div>
            <div class="col-xs-4">
                <div class="span4">
                    <h4 class="no-margins">返回消息：</h4>
                    <div class="input-group col-xs-12">
                        <textarea rows="8" id="msg" type="text" class="form-control" placeholder="" readonly></textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-4">
            </div>
        </div>
</div>
</div>


</body>
<script>
    $(function (){


        $("#sendSns").click(function () {
            url="/captchasms"
            var phonenum=$("#phonenumber").val()
            $.ajaxEasy({
                url: url,
                async: true,
                data:{
                    phonenum: phonenum
                },
                successCallBack: function (result) {
                    console.log("aa")
                    result=JSON.stringify(result)
                    $("#msg").val(result)
                }

            })
        })
    });

    function validate(){

        url="/validate"
        var phonenum=$("#phonenumber").val()
        var validateCode=$("#code").val()
        $.ajaxEasy({
            url: url,
            async: true,
            data:{
                phonenum: phonenum,
                validateCode: validateCode
            },
            successCallBack: function (result) {
                console.log("aa")
                result=JSON.stringify(result)
                $("#msg").val(result)
            }

        })
        return false
    }
</script>
</html>